package com.example.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

//员工表
@Data
@NoArgsConstructor
@TableName("employee")  //数据库表名
public class Employee {
    @TableId(value = "id",type = IdType.AUTO)     //表id
    private Integer id;
    @TableField("deptid")   //表字段
    private Integer deptid;
    private String lastName;
    private String password;
    private String email;
    private Integer gender; //0:女  1:男
    private Date birth;
    @TableField(exist = false)  //不是表字段
    private Department department;

    public Employee(Integer did, String lastName, String email, Integer gender, Department department) {
        this.id = did;
        this.lastName = lastName;
        this.email = email;
        this.gender = gender;
        this.department = department;
        //自动创建日期
        this.birth = new Date();
    }
}
